<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <%@ include file="/WEB-INF/component/commonTagLib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title><spring:message code="message.lable.expertSTDlog"/></title>
	<%@ include file="/WEB-INF/component/commonCSS.jsp" %> 
    <!--[if lt IE 9]>
        <script src="lib/js/html5shiv.min.js"></script>
        <script src="lib/js/respond.min.js"></script>
    <![endif]-->
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1><spring:message code="message.lable.expertSTDlog"/></h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i><spring:message code="message.lable.first"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.lable.StdManage"/></a></li>
            <li class="active"><a href=""><spring:message code="message.lable.expertStd"/></a></li>
        </ol>
    </section>
    
    <section class="content">
        <div class=" box box-success">
            <div class="box-body">
                <div class=" form-inline">
               
                     <div class="form-group form-group-xs">
                        <label for="searchPharCode"><spring:message code="message.listForm.xiuGaiRiQi"/>：</label>
                        <input class="form-control" id="startTime"   name="startTime" type="text" placeholder="yyyy-MM-dd" 
                         onFocus="var endDate=$dp.$('endTime');WdatePicker({maxDate:'#F{$dp.$D(\'endTime\')}'})" />
                        <label>-</label>
                        <input class="form-control" type="text" id="endTime" name="endTime"  placeholder="yyyy-MM-dd" maxlength="10"  
                         onFocus="WdatePicker({minDate:'#F{$dp.$D(\'startTime\')}'})" />
                    </div>
                   <button type="button" class="btn btn-success btn-sm" onclick="search();"><spring:message code="message.button.seachSpacing"/></button>
                </div>
            </div>
        </div>
        
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
        <div class=" box box-warning bottongroup">
	   
                <a href="expertList.html" class="btn btn-default btn-sm"><spring:message code="message.button.getBackSpacing"/></a>
      
        </div>
    </section>
    <%@ include file="/WEB-INF/component/commonJS.jsp" %>  
    <script type="text/javascript">
    
    //绑定回车
    $('#startTime,#endTime').bind('keydown', function(event) {
        if (event.keyCode == "13") {        //13 位电脑上回车键的位置代码
            $('#selectExpert').click();
        }
    });
    
        $(function () {
           /*  $('#addNew').click(function () {
                $('#exampleModal').modal({
                    keyboard: true
                });
            });
            $('#confirmtest').click(function () {
                $.HN.message.confirm('确定不通过吗？', '', '').on(function (e) {
                    if (e) {
                        $.HN.message.alert('操作成功！', '提示信息', 'success');
                    }
                });
            }) */
            $("#gridlist").jqGrid({
                url: "${ctx}/stdExpert/getExpertLogList.html",
                mtype: "post",
                datatype: "json",
                postData: {
                	"expertId" : "${expertId}"
                },
                autowidth: true,
                height: 255,
                colNames: [ '<spring:message code="message.jqGrid.cz"/>',
                            '<spring:message code="message.listForm.xiuGaiXiangQing"/>',
                            '专家编号', '专家姓名','性别','专家类别','职务', '单位','联系电话',   '出生日期',   '状态', 
                            '<spring:message code="message.listForm.xiuGaiRen"/>', 
                            '<spring:message code="message.listForm.xiuGaiShiJian"/>',
                            'logId'],
                colModel: [
					{ name: 'operate', width: 60, align: "center", formatter : function(val, opts, rowdata) {
					    return "<a href='${ctx}/stdExpert/toStdExpertLogDetail.html?logId="+ rowdata[0] + "' style='background:url(${ctx}/lib/img/icon/icon.png) no-repeat -100px 0px' class='opIcon' title='<spring:message code="message.jqGrid.cz.xiangQing"/>'></a>";
					    }
					},  
					 { name: 'detail',width: 600, align:"left" },
                    { name: 'expertCode', width: 120,align:"center",hidden:true },
                    { name: 'name', width: 90,align:"center",hidden:true },
                    { name: 'sex', width: 40,align:"center",hidden:true },
                    { name: 'expSkills', width: 100,align:"center" ,hidden:true},
                    { name: 'position', width: 80,align:"center" ,hidden:true},
                    { name: 'companyId', width: 150,align:"center" ,hidden:true},
                    { name: 'handphone', width: 100,align:"center" ,hidden:true},
                    { name: 'birthdayStr', width: 100,align:"center" ,hidden:true},
                    { name: 'status',width: 60, align:"center",hidden:true},
                    { name: 'updUser',width: 140, align:"center" },
                    { name: 'updDatetimeStr',width: 150, align:"center" },
                    
                    { name: 'logId' ,hidden:true, width: 120,align:"center"}
                ],
                rowNum: 20,
                rowList: [10, 20, 50,100],
                rownumbers: true,
                pager: "#gridpage",
                viewrecords: true,
                caption: "${expertCode} - ${name}&nbsp;<spring:message code="message.jqGrid.cz.weiHuJiLuLieBiao"/>",
                jsonReader: {
                    id: "ids"
                },
                gridComplete:function(){        
                    var page = $("#gridlist").jqGrid('getGridParam','page');
                    var rows = $('#gridlist').getGridParam("rowNum");
                    var maxnum = (rows*page).toString();
                    var len = (maxnum.length)*10;
                    $('.jqgfirstrow').find('td').eq(0).css('width',len+'px');
                    $('#gridlist_rn').css('width',len+'px');
                    
                }
            });
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            $(window).trigger("resize");
        });
        
        /* function deleteId(){
      	  $.HN.message.confirm('确定作废吗？', '', '').on(function (e) {
                if (e) {
                    $.HN.message.alert('操作成功！', '提示信息', 'success');
                }
            });
        }  */
      //查询
    	 function search() {
    		 var startTime = $("#startTime").val();
         	if (startTime.length>0){
         		startTime = startTime + " 00:00:00";
         	}
         	var endTime = $("#endTime").val();
         	if (endTime.length>0){
         		endTime = endTime + " 23:59:59";
         	}
     		$("#gridlist").jqGrid('setGridParam',{  
     	        datatype:'json',
     	        postData:{
     	        	"startTime":startTime, 
     	        	"endTime":endTime
     	        },
     			page:1
     	    }).trigger("reloadGrid"); //重新载入  
    	} 
        
        /**
         *详情链接触发到详情页面
         */
    //     function XQjsp(){
      //   	  window.location.href="/medstgmini/stdExpert/stdExpertLogDetail.html";
        //   }
    </script>
</body>
</html>